package tyk.Dao;

import com.alibaba.druid.support.json.JSONUtils;
import org.w3c.dom.ls.LSInput;

import java.sql.SQLException;
import java.util.Scanner;

/***
 *@title TestDao
 *@description <TODO description class purpose>
 *@author Tang'ya'kang
 *@VERSION 1.0.0
 *@CREATE 2023/5/4 22:36
 **/
public class TestDao extends BaseDao{
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");
        //增
//        String sql="insert into t_user (account,password,nickname) values (?,?,?);";
//        String account="曾棒bang",password="123456",nickname="天棒";
//        int rows=executeUpdate(sql,account,password,nickname);
//        if(rows>0) System.out.println("插入成功");
//        else System.out.println("插入失败");

        //删
//        String sql="delete from t_user where id = ?;";
//        String id;
//        Scanner scanner=new Scanner(System.in);
//        id=scanner.nextLine();
//        int rows=executeUpdate(sql,id);
//        if(rows>0) System.out.println("删除成功");
//        else System.out.println("删除失败");
        //改
//          String sql="update t_user set password = ? where account = ?;",account,newpassword;
//          Scanner scanner=new Scanner(System.in);
//          account=scanner.nextLine();
//          newpassword=scanner.nextLine();
//          int rows=executeUpdate(sql,newpassword,account);
//          if(rows>0) System.out.println("修改成功");
//          else System.out.println("修改失败");
    }
}
